﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PcArduinoControl
{
	class ResponseMessage :
		Message
	{
		public FailCode FailCode
		{
			get
			{
				return (FailCode)Arguments[0];
			}
		}

		public byte CommandId
		{
			get
			{
				return Arguments[1];
			}
		}

		internal ResponseMessage(byte id, byte checksum, FailCode failCode, byte commandId) :
			this(id, checksum, (byte)failCode, commandId)
		{
		}

		internal ResponseMessage(byte id, byte checksum, IEnumerable<byte> args) :
			this(id, checksum, args.ToArray())
		{
		}

		internal ResponseMessage(byte id, byte checksum, params byte[] args) :
			base(id, checksum, MessageType.Response, args)
		{
		}
	}
}
